Send_ATT_ReadByTypeRsp 0xc000, 0x1b, ""
Wait_HCI_Command_Complete_Event 5000, any

Send_ATT_ReadByTypeRsp 0xc000, 0x1b, ""
Wait_HCI_Command_Complete_Event 5000, any

Send_HCI_Read_Local_Supported_Commands
Wait_HCI_Command_Complete_Read_Local_Supported_Commands_Event 5000, any, HCI_Read_Local_Supported_Commands, 0x00, any

Send_HCI_Read_Local_Supported_Features
Wait_HCI_Command_Complete_Read_Local_Supported_Features_Event 5000, any

Send_HCI_Set_Event_Mask 0x08FFFFFFFFFFFFFF
Wait_HCI_Command_Complete_Set_Event_Mask_Event 5000, any

Send_HCI_LE_Set_Event_Mask 0x0000000000000fff, 0x0000000000000fff
Wait_HCI_Command_Complete_LE_Set_Event_Mask_Event 5000, any

Send_HCI_LE_Read_Buffer_Size
Wait_HCI_Command_Complete_LE_Read_Buffer_Size_Event 5000, any, HCI_LE_Read_Buffer_Size, 

Send_HCI_Read_Buffer_Size
Wait_HCI_Command_Complete_Read_Buffer_Size_Event 5000, any, HCI_Read_Buffer_Size,

Send_HCI_Read_BD_ADDR
Wait_HCI_Command_Complete_Read_BD_ADDR_Event 5000, any

Send_HCI_LE_Write_Suggested_Default_Data_Length 0xda9f, 0x0148
Wait_HCI_Command_Complete_LE_Write_Suggested_Default_Data_Length_Event 5000, any

Send_HCI_LE_Read_Suggested_Default_Data_Length
Wait_HCI_Command_Complete_LE_Read_Suggested_Default_Data_Length_Event 5000, any

#Send_GAP_DeviceInit 0x08, 8, 0, 0, 1
#Wait_HCI_Command_Complete_Event 5000, any

#Send_GAP_SetParam 2, 10000 
#Wait_HCI_Command_Complete_Event 5000, any

#Send_GAP_DeviceDiscoveryRequest 0x03, 0x00, 0
#Wait_HCI_Command_Complete_Event 5000, any

#WaitForAllEvents 12000, True

#Send_GAP_EstablishLinkReq 0, 0, 0, "1C:CA:E3:20:05:7D" 
#Send_GAP_ConfigDeviceAddr 0, "0c:8e:b3:48:4f:c3"
#Wait_HCI_Command_Complete_Event 5000, any

#Send_GAP_DeviceDiscoveryRequest 3, 1, 0
#Wait_HCI_Command_Complete_Event 5000, any

Send_HCI_LE_Set_Scan_Parameters 0x01, 0x0010, 0x0010, 0x00, 0x00
Wait_HCI_Command_Complete_LE_Set_Scan_Parameters_Event 5000, any, HCI_LE_Set_Scan_Parameters, 

Send_HCI_LE_Set_Scan_Enable 0x01, 0x01
Wait_HCI_Command_Complete_LE_Set_Scan_Enable_Event 5000, any

WaitForAllEvents 50000, True
